package main

import (
	"fmt"
	"log"
	"net/http"
)

func main() {

	http.HandleFunc("/", HelloWorld)
	http.HandleFunc("/hello", Hello)

	err := http.ListenAndServe("localhost:8888", nil)
	if err != nil {
		log.Fatal("Start Server Error.", err.Error())
		return
	}
}

func Hello(writer http.ResponseWriter, request *http.Request) {
	fmt.Println("exec Hello function")
	fmt.Fprintf(writer, "Hello gogogo")
}

func HelloWorld(writer http.ResponseWriter, request *http.Request) {
	fmt.Println("execute HelloWorld function")
	fmt.Fprintf(writer, "Hello World Hello World")
}
